#include "BookShelfIterator.h"
#include <iostream>

BookShelfIterator::BookShelfIterator(BookShelf* b) : bookShelf(b), index(0){}

Book BookShelfIterator::next()
{
    return bookShelf->getBookAt(index++);
}

bool BookShelfIterator::hasNext()
{
    return bookShelf->getLength() > index;
}

BookShelfIterator::~BookShelfIterator()
{
    std::cout << "Iterator Destroyed." << std::endl;
}